<?xml version='1.0' encoding='ISO-8859-1'?>

<ui:composition template="templates/template.xhtml" xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:c="http://java.sun.com/jstl/core">

	<ui:define name="popupContent">

		<rich:panel id="popupBloqueio" styleClass="popupModal" bodyClass="popupBody" headerClass="popupHeader" rendered="#{monitoramentoBean.popupBloqueio}">
			<f:facet name="header">
	            <h:panelGroup>
					<h:commandLink action="${monitoramentoBean.close}" immediate="true">
	                	<h:graphicImage value="/images/icons/close.png" style="cursor:pointer"/>
					</h:commandLink>
	            </h:panelGroup>
			</f:facet>
			<c:if test="#{monitoramentoBean.bloquearVeiculoStatus || monitoramentoBean.desbloquearVeiculoStatus}">
				<ui:include src="comandos/Bloqueio.xhtml" />
			</c:if>
			<c:if test="#{monitoramentoBean.acionarSireneStatus || monitoramentoBean.desligarSireneStatus}">
				<ui:include src="comandos/Sirene.xhtml" />
			</c:if>
			<c:if test="#{monitoramentoBean.habilitarEscutaStatus}">
				<ui:include src="comandos/Escuta.xhtml" />
			</c:if>
			<c:if test="#{monitoramentoBean.enviarMsgTextoStatus}">
				<ui:include src="comandos/TerminalTexto.xhtml" />
			</c:if>
		</rich:panel>

		<rich:panel id="innerPopup" styleClass="popup" bodyClass="popupBody" headerClass="popupHeader" rendered="#{controlBean.opened}" >


			<c:if test="#{controlBean.areaBean}">
				<c:if test="#{areaBean.updateState || areaBean.saveState}">
					<ui:include src="cadastros/Area/Area.xhtml" />
				</c:if>
				<c:if test="#{areaBean.searchState}">
					<ui:include src="cadastros/Area/AreaList.xhtml" />
				</c:if>
			</c:if>

			<c:if test="#{controlBean.bairroBean}">
				<c:if test="#{bairroBean.updateState || bairroBean.saveState}">
					<ui:include src="cadastros/Bairro/Bairro.xhtml" />
				</c:if>
				<c:if test="#{bairroBean.searchState}">
					<ui:include src="cadastros/Bairro/BairroList.xhtml" />
				</c:if>
			</c:if>

			<c:if test="#{controlBean.cidadeBean}">
				<c:if test="#{cidadeBean.updateState || cidadeBean.saveState}">
					<ui:include src="cadastros/Cidade/Cidade.xhtml" />
				</c:if>
				<c:if test="#{cidadeBean.searchState}">
					<ui:include src="cadastros/Cidade/CidadeList.xhtml" />
				</c:if>
			</c:if>

			<c:if test="#{controlBean.clienteBean}">
				<c:if test="#{clienteBean.updateState || clienteBean.saveState}">
					<ui:include src="cadastros/Cliente/Cliente.xhtml" />
				</c:if>
				<c:if test="#{clienteBean.searchState}">
					<ui:include src="cadastros/Cliente/ClienteList.xhtml" />
				</c:if>
			</c:if>

			<c:if test="#{controlBean.equipamentoBean}">
				<c:if test="#{equipamentoBean.updateState || equipamentoBean.saveState}">
					<ui:include src="cadastros/Equipamento/Equipamento.xhtml" />
				</c:if>
				<c:if test="#{equipamentoBean.searchState}">
					<ui:include src="cadastros/Equipamento/EquipamentoList.xhtml" />
				</c:if>
			</c:if>

			<c:if test="#{controlBean.estadoBean}">
				<c:if test="#{estadoBean.updateState || estadoBean.saveState}">
					<ui:include src="cadastros/Estado/Estado.xhtml" />
				</c:if>
				<c:if test="#{estadoBean.searchState}">
					<ui:include src="cadastros/Estado/EstadoList.xhtml" />
				</c:if>
			</c:if>

			<c:if test="#{controlBean.grupoBean}">
				<c:if test="#{grupoBean.updateState || grupoBean.saveState}">
					<ui:include src="cadastros/Grupo/Grupo.xhtml" />
				</c:if>
				<c:if test="#{grupoBean.searchState}">
					<ui:include src="cadastros/Grupo/GrupoList.xhtml" />
				</c:if>
			</c:if>

			<c:if test="#{controlBean.permissaoBean}">
				<c:if test="#{permissaoBean.updateState || permissaoBean.saveState}">
					<ui:include src="cadastros/Permissao/Permissao.xhtml" />
				</c:if>
				<c:if test="#{permissaoBean.searchState}">
					<ui:include src="cadastros/Permissao/PermissaoList.xhtml" />
				</c:if>
			</c:if>

			<c:if test="#{controlBean.pontoBean}">
				<c:if test="#{pontoBean.updateState || pontoBean.saveState}">
					<ui:include src="cadastros/Ponto/Ponto.xhtml" />
				</c:if>
				<c:if test="#{pontoBean.saveImportarPontoState}">
					<ui:include src="cadastros/Ponto/ImportarPontos.xhtml" />
				</c:if>
				<c:if test="#{pontoBean.searchState}">
					<ui:include src="cadastros/Ponto/PontoList.xhtml" />
				</c:if>
			</c:if>

			<c:if test="#{controlBean.usuarioBean}">
				<c:if test="#{usuarioBean.updateState || usuarioBean.saveState}">
					<ui:include src="cadastros/Usuario/Usuario.xhtml" />
				</c:if>
				<c:if test="#{usuarioBean.searchState}">
					<ui:include src="cadastros/Usuario/UsuarioList.xhtml" />
				</c:if>
			</c:if>

			<c:if test="#{controlBean.veiculoBean}">
				<c:if test="#{veiculoBean.updateState || veiculoBean.saveState}">
					<ui:include src="cadastros/Veiculo/Veiculo.xhtml" />
				</c:if>
				<c:if test="#{veiculoBean.searchState}">
					<ui:include src="cadastros/Veiculo/VeiculoList.xhtml" />
				</c:if>
				<c:if test="#{veiculoBean.deleteState}">
					<ui:include src="cadastros/Veiculo/VeiculoDelete.xhtml" />
				</c:if>
			</c:if>

			<c:if test="#{controlBean.monitoramentoBean}">
				<c:if test="#{monitoramentoBean.updateState || monitoramentoBean.saveState}">
					<ui:include src="cadastros/Monitoramento/Monitoramento.xhtml" />
				</c:if>
				<c:if test="#{monitoramentoVeiculoBean.searchState}">
					<ui:include src="cadastros/Monitoramento/MonitoramentoList.xhtml" />
				</c:if>
			</c:if>

			<c:if test="#{controlBean.veiculoBean}">
				<c:if test="#{veiculoBean.searchTransmissaoState}">
					<ui:include src="cadastros/Transmissao/TransmissaoList.xhtml" />
				</c:if>
			</c:if>

			<c:if test="#{controlBean.marcaBean}">
				<c:if test="#{marcaBean.updateState || marcaBean.saveState}">
					<ui:include src="cadastros/Marca/Marca.xhtml" />
				</c:if>
				<c:if test="#{marcaBean.searchState}">
					<ui:include src="cadastros/Marca/MarcaList.xhtml" />
				</c:if>
			</c:if>

			<c:if test="#{controlBean.modeloBean}">
				<c:if test="#{modeloBean.updateState || modeloBean.saveState}">
					<ui:include src="cadastros/Modelo/Modelo.xhtml" />
				</c:if>
				<c:if test="#{modeloBean.searchState}">
					<ui:include src="cadastros/Modelo/ModeloList.xhtml" />
				</c:if>
			</c:if>

		</rich:panel>

	</ui:define>

</ui:composition>